<?php
namespace Home\Controller;
use Think\Controller;
use Org\Util\Curl;
class IndexController extends Controller {
    public function index(){
      phpinfo();
        die;
    }
    public function a(){
        phpinfo();
    }
    public function test(){
        $arr=array(
            "openid"=>"ofKIus5aIvnjwPMbpzA-oJqpIgQI",
            "body"=> "ccccc",
            "out_trade_no"=> "wx854fe8deb40549d214520525179560",
            "total_fee"=> 1,
            "notify_url"=> "http://www.cnovm.com/Weixin/notify.html",
            "trade_type"=> "JSAPI",
            "appid"=> "wx854fe8deb40549d2",
            "mch_id"=>  "1226968002",
            "spbill_create_ip"=> "36.110.70.38",
            "nonce_str"=> "9gjufqvhu8psck7bmbxu3yez15c9edx8",
            "sign"=>  "5D4DE83A880221F2AA14C1E43D44388F",
        );
        $xml = "<?xml version='1.0' encoding='utf-8'?>";

        foreach ($arr as $key=>$val)
        {

            if (is_numeric($val))
            {
                $xml.="<".$key.">".$val."</".$key.">";

            }else{

                $xml.="<".$key."><![CDATA[".$val."]]></".$key.">";


            }
        }


        $xml.="</xml>";
       echo $xml;

    }




}